<?php 

require('../connect_db.php');

$p_id = $_GET['id'];

$product_result = mysql_query("SELECT * FROM producten WHERE Productid = ".$p_id." ") or die(mysql_error());

$product_winkelmand = mysql_query("SELECT * FROM winkelmand")  or die(mysql_error());

$inhoud_winkelmand = mysql_query("INSERT INTO winkelmand (Productid, Aantal) VALUES(".$p_id.", 1)") or die(mysql_error());

$aantal = $product_winkelmand['Aantal'];

while($winkelmand_row = mysql_fetch_array($product_winkelmand))
{
	if($p_id == $p_id)
	{
		$update_aantal = mysql_query("UPDATE winkelmand SET Aantal+1");
	}
}

echo "<div style='width:80%; float:left; font:28px, Times new Roman;'><strong> Winkelmandje </strong>
	<table border='1'>
	<tr>
			<td width='450' align='center'><strong>Naam</strong></td>
			<td width='150' align='center'><strong>Prijs</strong></td>
	</tr>";
	
while($product_row = mysql_fetch_array($product_result))
	{
	  echo "<tr>
			<td align='left'>".$product_row['Naam']."</td>
			<td align='center'>".$product_row['Prijs']."</td>
			
		</tr>";
	}		
	
echo "</table>";

?>